from time import sleep
from selenium import webdriver


class FoxDriverUtil(object):
    __fox_driver = None

    @classmethod
    def get_driver(cls):
        if cls.__fox_driver == None:
            cls.__fox_driver = webdriver.Firefox()
            cls.__fox_driver.get('http://192.168.48.130/')
            cls.__fox_driver.maximize_window()

        return cls.__fox_driver

    @classmethod
    def quite_driver(cls):
        if cls.__fox_driver:
            sleep(1)
            cls.__fox_driver.quit()
            cls.__fox_driver = None


if __name__ == '__main__':
    fox_driver = FoxDriverUtil()

    fox_driver.get_driver()

    fox_driver.quite_driver()
